<h1>Dashboard</h1>
<div class="row">
<div class="col-lg-2">
  <h3>Find a Store</h3>
  <p><img src="images/australia.jpg" usemap="#LocMap" border="0" height="352" width="352" />
  <span></p>
  </div>
  <div class="col-lg-4">
	    <h3>&nbsp;</h3>
</div>
  <div class="col-lg-4">
    <h3>Last Visited Stores</h3>
    <ul>
      <?php if ($contact_logs){?>
      <?php foreach ($contact_logs as $log){?>
      <?php $store = Distributors::model()->findByPk($log->distributor_id);?>
      <?php $user = User::model()->findByPk($log->user_id);?>
      <?php $days = round((time() - strtotime($log->log_date))/(3600*24));?>
      <?php if ($days == 0){
		    			$days = 'today';
		    		}elseif ($days == 1){
		    			$days = 'yesterday';
		    		}else{
		    			$days = $days . ' ago';
		    		}?>
      <?php if(isset($store->id)){?>
      <li> <a href="/distributors/view/<?php echo $store->id;?>"><?php echo $store->title;?></a>by <a href="/users/profile/<?php echo $user->id?>"><?php echo $user->fname . ' ' . $user->lname?></a> <?php echo $days;?>. </li>
      <?php }?>
      <?php }?>
      <?php }?>
    </ul>
 
</div>
<map name="LocMap" id="LocMap">
  <area shape="poly" coords="213,58,213,153,226,153,227,187,292,187,299,183,315,191,325,186,333,186,333,163,251,5,233,75,213,58" href="distributors/states/1" alt="QLD Distributors" />
  <area shape="poly" coords="227,188,289,188,302,187,310,195,332,190,296,255,295,244,287,241,280,248,281,259,292,272,225,233,227,187" href="distributors/states/2" alt="Distributors NSW" />
  <area shape="circle" coords="288,253,7" href="distributors/states/4" alt="Distributors ACT" />
  <area shape="poly" coords="226,237,226,274,240,282,252,272,253,282,262,283,272,275,290,274,225,235" href="distributors/states/3" alt="Distributors Victoria" />
  <area shape="poly" coords="131,153" href="distributors/states/8" alt="Distributors N.T."/>
  <area shape="poly" coords="131,153,222,153,224,273,215,260,205,234,202,215,186,239,170,211,131,210,131,153" href="distributors/states/6" alt="Distributors S.A." />
  <area shape="poly" coords="248,298,275,308,259,334,248,296" href="distributors/states/5" alt="Distributors Tasmania" />
  <area shape="poly" coords="129,212,129,42,123,49,113,32,51,103,9,127,37,249,127,212" href="distributors/states/7" alt="Distributors W.A." />
  <area shape="poly" coords="132,43,132,151,211,151,210,56,185,38,199,14,158,11,140,22,131,42" href="distributors/states/7"  />
</map>
</div>
